package com.example.rabbitmq.consumer;

import com.example.rabbitmq.config.Confirmconfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Date 2021/7/21 16:18
 * @Created by wangle
 * @Description 接受消息
 */
@Slf4j
@Component
public class Consumer {
    @RabbitListener(queues = Confirmconfig.queuename)
    public void receiveconfirmmessage(Message message){
        System.out.println(new String(message.getBody()));
       log.info("接受到的消息队列是{}",new String(message.getBody()));

    }



}
